import { DELETE, POST, GET } from '../request'
import API from './url'
import { HOST } from '../utils/const'

const {mine} = API

/**
 * 获取用户金币明细
 * @param {string} userId   用户id
 * @returns 
 */
const getCoindetail = (userId) =>{
    return GET(HOST+mine.getCoindetail,userId)
}


/**
 * 获取用户信息
 * @param {string} userId  用户id
 * @returns 
 */
const getuserinfo = (userId)=>{
    return GET(HOST+mine.getuserinfo,userId)
}

/**
 * 修改用户信息
 * @param {string} userId  用户id
 * @returns 
 */
const edituser = (userId)=>{
    return POST(HOST+mine.edituser,userId)
}

/**
 * 获取我的收藏列表
 * @param {string} userId  用户id
 * @returns 
 */
const getmyCollectionapp = (userId)=>{
    return GET(HOST+mine.getmycollectionapp,userId)
}

/**
 * 上传图片
 * @param {string} file   文件
 * @returns 
 */
const uploadFile = (data)=>{
    return POST(HOST+mine.uploadFile,data)
}

export {
    getCoindetail,
    getuserinfo,
    edituser,
    getmyCollectionapp,
    uploadFile
}
